﻿using System;
using System.Collections.Generic;
using GpuHud.Settings;
using TMPro;
using UnityEngine;

namespace GpuHud
{
    [Serializable]
    public struct GpuHudAssetMap
    {
        [SerializeField]
        int hudAssetId;
        [SerializeField]
        GpuHudAsset hudAsset;
        [SerializeField]
        GpuHudEntityType hudEntityType;
    }

    [Serializable]
    public struct HudCurve
    {
        [SerializeField]
        AnimationCurve m_animCurve;
    }

    public class GpuHudSettings: ScriptableObject
    {
        #region 默认参数
        [SerializeField]
        public Mesh mesh;
        [SerializeField]
        private TMP_FontAsset m_DefaultFontAsset;
        public TMP_FontAsset DefaultFontAsset => m_DefaultFontAsset;
        
        //--------HealthBarStyleMaterial--------//
        [SerializeField]
        public Material HealthBarStyleMaterial;

        public static string DefaultResourcePath => "Assets/ResourcesAssets/Config/GPUHUDConfig/" + nameof(GpuHudSettings) + ".Asset";
        #endregion

        #region 参数控制库

        public List<MaterialParamsSetting> mapGroup;
        public Dictionary<MatGroupType, int> matGroupMap;
        public void InitRuntime()
        {
            matGroupMap = new Dictionary<MatGroupType, int>();
            for (int i = 0; i < mapGroup.Count; ++i)
            {
                matGroupMap.Add(mapGroup[i].GroupType,i);
            }
        }
        #endregion

        
    }
}
